#!/bin/bash

add(){
	local re=$(($1+$2))
	echo $re
	return 0
}

minus(){
	local re=$(($1-$2))
	echo $re
	return 0

}

multiplication(){
	local re=$(($1*$2))
	echo $re
	return 0

}

division(){
	local re=$(($1/$2))
	echo $re
	return 0

}

compare(){
	if (($1>=$2));then
	re=$1
	else
	re=$2
	fi
	echo $re
	return 0

}

case $1 in

1)
	echo 请输入两个整数
	read num1 num2
	add $num1 $num2
	;;
2)
	echo 请输入两个整数
	read num1 num2
	minus $num1 $num2

	;;
3)
	echo 请输入两个整数
	read num1 num2
	multiplication $num1 $num2

	;;
4)
	echo 请输入两个整数
	read num1 num2
	division $num1 $num2
	;;
5)
	echo 请输入两个整数
	read num1 num2
	compare $num1 $num2
	
	;;
6)
	exit
	;;
esac

